package com.iscreen.core.services.extractor;

import java.util.List;

import javax.ejb.Stateless;

import org.jboss.ejb3.annotation.RemoteBinding;

import com.iscreen.utils.exceptions.IScreenException;
import com.iscreen.utils.zip.ZipUtils;

/**
 * Session Bean implementation class DownloaderBean
 */
@Stateless
@RemoteBinding(jndiBinding="Extractor")
public class ExtractorBean implements Extractor {

    /**
     * Default constructor. 
     */
    public ExtractorBean() {
        // TODO Auto-generated constructor stub
    }

    @Override
    public List<String> extract(ExtractMessage extractMessage)
    {
    	try
		{
    		return ZipUtils.extract(extractMessage.getZipFile(), extractMessage.getDestinationDir());
		}
		catch (IScreenException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
    }
}
